package joyi.train.moloch.controller;

import j.framework.core.LoginUser;
import j.util.web.BaseController;
import j.util.web.HttpView;
import j.util.web.WebRequest;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import java.io.IOException;

/**
 * 注释模板
 */
@WebServlet(urlPatterns = "/moloch")
public class TrainController extends BaseController {
    @Override
    public void doDefaultGet(HttpView view) throws ServletException, IOException {

    }
    @WebRequest(action = "checkuser")
    public void doLogin(HttpView view) throws ServletException, IOException {
        LoginUser user = new LoginUser();
        user.setUserId("001");
        user.setName("培训");
        user.setLoginName("admin");
        view.getRequest().getSession().setAttribute(LoginUser.SESSION_KEY,user);
        view.getResponse().sendRedirect("/index.jsp");
    }
}
